<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Estimate anomaly detection jobs model memory API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'ml-estimate-model-memory.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-estimate-model-memory.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-estimate-model-memory.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/ml-estimate-model-memory.html" rel="nofollow" target="_blank">../en/ml-estimate-model-memory.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="ml-apis.html">Machine learning anomaly detection APIs</a></span>
»
<span class="breadcrumb-node">Estimate anomaly detection jobs model memory API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="ml-delete-expired-data.html">« Delete expired data API</a>
</span>
<span class="next">
<a href="ml-find-file-structure.html">Find file structure API »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="ml-estimate-model-memory"></a>Estimate anomaly detection jobs model memory API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/estimate-model-memory.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<p>Makes an estimation of the memory usage for an anomaly detection job model. It
is based on analysis configuration details for the job and cardinality estimates for the
fields it references.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-estimate-model-memory-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/estimate-model-memory.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">POST _ml/anomaly_detectors/_estimate_model_memory</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-estimate-model-memory-prereqs"></a>Prerequisites<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/estimate-model-memory.asciidoc">edit</a>
</h3>
</div></div></div>
<p>If the Elasticsearch security features are enabled, you must have the following
equivalent privileges:</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<code class="literal">manage_ml</code> or cluster: <code class="literal">manage</code>
</li>
</ul>
</div>
<p>For more information, see <a class="xref" href="security-privileges.html" title="Security privileges">Security privileges</a>.</p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-estimate-model-memory-request-body"></a>Request body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/estimate-model-memory.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">analysis_config</code>
</span>
</dt>
<dd>
(Required, object)
For a list of the properties that you can specify in the <code class="literal">analysis_config</code>
component of the body of this API, see <a class="xref" href="ml-put-job.html#put-analysisconfig"><code class="literal">analysis_config</code></a>.
</dd>
<dt>
<span class="term">
<code class="literal">max_bucket_cardinality</code>
</span>
</dt>
<dd>
(Required<sup>*</sup>, object)
Estimates of the highest cardinality in a single bucket that is observed for
influencer fields over the time period that the job analyzes data. To produce a
good answer, values must be provided for all influencer fields. Providing values
for fields that are not listed as <code class="literal">influencers</code> has no effect on the estimation.<br>
<sup>*</sup>It can be omitted from the request if there are no <code class="literal">influencers</code>.
</dd>
<dt>
<span class="term">
<code class="literal">overall_cardinality</code>
</span>
</dt>
<dd>
(Required<sup>*</sup>, object)
Estimates of the cardinality that is observed for fields over the whole time
period that the job analyzes data. To produce a good answer, values must be
provided for fields referenced in the <code class="literal">by_field_name</code>, <code class="literal">over_field_name</code> and
<code class="literal">partition_field_name</code> of any detectors. Providing values for other fields has
no effect on the estimation.<br>
<sup>*</sup>It can be omitted from the request if no detectors have a <code class="literal">by_field_name</code>,
<code class="literal">over_field_name</code> or <code class="literal">partition_field_name</code>.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-estimate-model-memory-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/estimate-model-memory.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST _ml/anomaly_detectors/_estimate_model_memory
{
    "analysis_config": {
        "bucket_span": "5m",
        "detectors": [
          {
            "function": "sum",
            "field_name": "bytes",
            "by_field_name": "status",
            "partition_field_name": "app"
          }
        ],
        "influencers": [ "source_ip", "dest_ip" ]
    },
    "overall_cardinality": {
       "status": 10,
       "app": 50
    },
    "max_bucket_cardinality": {
       "source_ip": 300,
       "dest_ip": 30
    }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1813.console"></div>
<p>The estimate returns the following result:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "model_memory_estimate": "21mb"
}</pre>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="ml-delete-expired-data.html">« Delete expired data API</a>
</span>
<span class="next">
<a href="ml-find-file-structure.html">Find file structure API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>